home *** CD-ROM | disk | FTP | other *** search
- /*
- File: MouseModule.h
-
- Contains: Header file for mouse module
-
- Version: xxx put version here xxx
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
-
- */
- #ifndef __MouseModuleH__
- #define __MouseModuleH__
-
- #include <Types.h>
- #include <Devices.h>
- #include <DriverServices.h>
- #include <Processes.h>
- #include <CursorDevices.h>
- #include <USB.h>
-
- #define kMouseModuleName "\pUSBHIDMouseModule"
-
- Boolean immediateError(OSStatus err);
- void InitParamBlock(USBReference theInterfaceRef, USBPB * paramblock);
- void MouseInitiateTransaction(USBPB *pb);
- void MouseCompletionProc(USBPB *pb);
- void InterfaceEntry(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterfaceDescriptor, USBDeviceDescriptorPtr pDeviceDescriptor, USBDeviceRef device);
-
- /* Prototypes from MouseModuleHeader.c Tue, Mar 17, 1998 3:30:22 PM */
- static OSStatus MouseDeviceInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
- static OSStatus MouseInterfaceInitialize(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device);
- static OSStatus MouseModuleFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc);
-
- /* Prototypes from MouseConfigParse.c Tue, Mar 17, 1998 3:17:14 PM */
-
- OSStatus USBHIDControlDevice(UInt32 theControlSelector, void * theControlData);
- void NotifyRegisteredHIDUser(UInt32 devicetype, UInt8 hidReport[]);
-
- void USBMouseIn(UInt32 refcon, void * theData);
-
- #define kMouseRetryCount 3
-
- enum driverstages
- {
- kUndefined = 0,
- kSetProtocol,
- kSetIdleRequest,
- kConfigureInterface,
- kFindPipe,
- kReadInterruptPipe,
- kClearFeature,
- kReturnFromDriver = 0x1000,
- kRetryTransaction = 0x2000,
- kSyncTransaction = 0x4000,
- kCompletionPending = 0x8000
- };
-
- typedef struct
- {
- USBPB pb;
- void (*handler)(USBPB *pb);
-
- Boolean intPipeAborted;
- Boolean driverRemovalPending;
-
- USBReference interfaceRef;
- USBPipeRef pipeRef;
-
- USBDeviceDescriptor deviceDescriptor;
- USBInterfaceDescriptor interfaceDescriptor;
-
- UInt32 hidDeviceType;
- UInt8 hidReport[64];
- UInt32 maxPacketSize;
-
- HIDInterruptProcPtr pSHIMInterruptRoutine;
- HIDInterruptProcPtr pSavedInterruptRoutine;
-
- UInt32 interruptRefcon;
-
- SInt32 retryCount;
- SInt32 transDepth;
-
- CursorDevicePtr pCursorDeviceInfo;
- CursorDevice cursorDeviceInfo;
- Fixed unitsPerInch;
- } usbMousePBStruct;
-
- #endif //__MouseModuleH__